package Filter.Filter02;

import jakarta.servlet.*;
import jakarta.servlet.annotation.WebFilter;

import java.io.IOException;
import java.io.PrintWriter;

@WebFilter(filterName = "ForWardFilter",urlPatterns = "/first.jsp",dispatcherTypes = DispatcherType.FORWARD)
public class ForwardFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        PrintWriter out = servletResponse.getWriter();
        out.write("<h1>Hello MyFilterTest</h1>");
    }

    @Override
    public void destroy() {
    }
}
